<?php

require_once 'Zend/Validate/Abstract.php';

class Zend_Validate_IsSelected extends Zend_Validate_Abstract
{
    protected $_messageTemplates = array(
        self::INVALID      => "Must be choosen a value from the list"
    );

    protected $_exceptionValue;
	
    public function __construct($exceptionValue = 'None')
    {
        $this->_exceptionValue = $exceptionValue;
    }

    public function isValid($value)
    {
        $this->_setValue($value);

        if ($this->_exceptionValue === $value) {
            $this->_error(self::INVALID);
            return false;
        }

        return true;
    }

} 